package org.example;

import javax.xml.bind.SchemaOutputResolver;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @ClassName Demo5
 * @Description
 * @Author zhangsw
 * @Date 2020/11/10 10:19
 * @Version 1.0
 */
public class Demo5 {
    public static void main(String[] args) {
        List<Integer> list50 = new ArrayList<>();
        List<Integer> list100 = new ArrayList<>();
        List<Integer> list150 = new ArrayList<>();
        List<Integer> list200 = new ArrayList<>();
        for (int i = 0; i < 10000; i++) {
            Integer randomMoney = Arrays.asList(50, 100, 150, 200).get((int) (Math.random() * 4));
            if (randomMoney == 50) {
                list50.add(randomMoney);
            }
            if (randomMoney == 100) {
                list100.add(randomMoney);
            }
            if (randomMoney == 150) {
                list150.add(randomMoney);
            }
            if (randomMoney == 200) {
                list200.add(randomMoney);
            }
            System.err.println(randomMoney);
        }

        System.err.println("50 : " + list50.size());
        System.err.println("100 : " + list100.size());
        System.err.println("150 : " + list150.size());
        System.err.println("200 : " + list200.size());

    }
}
